<script setup>
  import {ref,onUpdated} from 'vue'
  import { useRouter } from 'vue-router';

  let myPath = ref("")
  let route = useRouter()

  function changePage(){
    route.push(myPath.value)
  }

  function sendparameter(id,language){
    route.push(`/showDetail2?id=${id}&&language=${language}`)
  }



</script>

<template>
  <div>
    <router-link to="/home">Home</router-link><br>
    <router-link to="/list">List</router-link><br>
    <router-link to="/add">Add</router-link><br>
    <router-link to="/update">Update</router-link><br>
    <hr>
    <router-view></router-view>
    <hr>
    <button @click="changePage()">Go</button><input type="text" v-model="myPath">
    <hr>
    路由传参<br>
    <router-link to="/showParamDeatails/1/java">路由路径传参</router-link><br>
    <router-link to="/showDetail2?id=2&&language=PHP">路由路径传参</router-link><br>
    <button @click="sendparameter(3,'PHP')">路由键值对传参</button>
    <hr>

    <router-view name="routeParam"></router-view>


  </div>

</template>

<style scoped>

</style>
